This disclosure generally relates to methods and systems for minimizing the effects of garbage collection in a computing application. The methods and systems are particularly suitable for use in document processing or editing applications on mobile devices but are also generally applicable to any applications on any computing device.
Mobile devices such as smart phones and tablets typically have limited memory and processing power compared to desktop computers and servers. As a result, mobile device applications must be particularly careful in managing memory usage to be fast and responsive. Conventional mobile device applications often use a garbage collector to manage memory usage.
However, the garbage collector can cause significant performance problems. Typically, the garbage collector waits until the amount of available memory drops below a certain threshold before running a garbage collection pass. Unfortunately, running the garbage collector often prevents or slows user interaction with the application, resulting in noticeable delays to the user. Such delays are particularly substantial for mobile devices because garbage collection may occur often and may require more time to complete due to low memory and processing resources. These delays are undesirable and disruptive to users who want responsive and robust applications.